from offer.data_structure import BinaryTreeNode


class Task27:
    def run(self, tree):
        if tree is None:
            return None
        else:
            node = BinaryTreeNode(tree.val)
            node.left = self.run(tree.right)
            node.right = self.run(tree.left)
            return node
